package model

import "RMS/app/shop/model/base"

type ItemListReq struct {
	Id         *int    `form:"id" json:"id"`
	Name       *string `form:"item_name" json:"item_name"`
	CategoryId *int    `form:"category_id" json:"category_id"`
	PageIndex  *int    `form:"page_index"`
	PageSize   *int    `form:"page_size"`
}

type ItemListResp struct {
	Data  []map[string]interface{} `json:"data"`
	Total int                      `json:"total"`
	base.Resp
}

type AddItemReq struct {
	Name        string   `json:"name,required"`
	Price       float64  `json:"price,required"`
	Discount    *float64 `json:"discount"`
	CategoryId  int      `json:"category_id,required"`
	Status      int      `json:"status,required"`
	Extra       *string  `json:"extra"`
	PictureUrls *string  `json:"picture_urls"`
}

type AddItemResp struct {
	base.Resp
}

type UpdateItemReq struct {
	Id          int      `json:"id,required"`
	Name        *string  `json:"name"`
	Price       *float64 `json:"price"`
	Discount    *float64 `json:"discount"`
	CategoryId  *int     `json:"category_id"`
	Status      *int     `json:"status"`
	Extra       *string  `json:"extra"`
	PictureUrls *string  `json:"picture_urls"`
}

type UpdateItemResp struct {
	base.Resp
}

type DeleteItemReq struct {
	Id int `json:"id,required"`
}

type DeleteItemResp struct {
	base.Resp
}
